import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App.vue';
import router from './router.js';
Vue.config.productionTip = false;
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import './css/index.css';
Vue.use(VueRouter);
Vue.use(ViewUI);

import vueiInfinite from 'vue-infinite-scroll';
Vue.use(vueiInfinite);
import VueLazyload from 'vue-lazyload';
Vue.use(VueLazyload, {
	preLoad: 1.3,
	error: require('./imgs/unnamed.gif'),
	loading: require('./imgs/unnamed.gif'),
	attempt: 1,
});

//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push;
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch((err) => err);
};

new Vue({
	render: (h) => h(App),
	router,
}).$mount('#app');
